{
  class Animal {
    protected name: string;
    constructor(name: string) {
      this.name = name
    }
    run() {
      return `${this.name}is running`
    }
  }

  const snake = new Animal('lily')
  snake.run();

  class Dog extends Animal {
    bark() {
      this.name = 'jjjjj';
      return `${this.name}is barking`;
    }
  }

  const xiaobao = new Dog('xiaobao')

  xiaobao.run()

  class Cat extends Animal {
    constructor(name) {
      super(name);
      console.log(this.name)
    }
    run() {
      return 'Me, ' + super.run()
    }
  }

  const mycat = new Cat('fugui')


  interface ClockInterface{
    currentTime: number;
    alert:()=>void;
  }

  interface ClockStatic {
    new (h: number, m: number): void;
    time: string // 定义static
  }

  const Clock:ClockStatic = class Clock implements ClockInterface {
    constructor(h: number, m: number) {
      
    }
     currentTime = 1234;
    alert() {

    }
    static time = 'jjj'
  }

  interface GameInterfack {
    play(): void
  }

  class Cellphone implements ClockInterface, GameInterfack {
    currentTime = 1234;
    alert() {

    }
    play() {
      
    }
  }

  function echo<T>(arg:T) {
    return arg
  }

  echo<number>(1)

  interface abv{
    (num: number):string
    num11: string
  }

  const fff:abv = function (params:number) {
    return params + ''
  }

  fff.num11 = 'jjj';

  function ech1o<T>(arg: T):T {
    return arg
  }

  interface abccc {
    a: number
  }

  const cc:abccc & {children?: string} = {a: 123, children: 'jjj'}

  let numbbb: number | string;

  function getLength(input:number | string) {
    const str = input as string;
    if(str.length) {

    }
  }


  interface abcc {
    name: string
    key: number
  }

  type abccPartial = Partial<abcc>;

  let ccccc:abccPartial = {
    name: 'jjj'
  }

  type ccccx =  {
    [key in 'j' | 'z']: string
  };

  let cdac:ccccx = {
    j: 'jjj',
    z: 'jfdsjlkdsf'
  }

  type ccaaa = keyof ccccx;
  type ccaaaKye = ccccx['j'];

  type Test<T> = {
    [key in keyof T]?: T[key]
  }

  type cccc = Test<ccccx>;

  type Test2<T> = {
    readonly [key in keyof T]: T[key]
  }

  type zzz = Test2<ccccx>;
  const zzz1:zzz = {
    j: '2',
    z: '4'
  }

  type ID = string | number;
  type TestID<T> = T extends string ? true : false extends T ? '1' : 3;

  let cddddc:TestID<false> = '1'

  interface T1 {
    name: string
  }

  interface T2 {
    sex: string
  }

  interface T3 extends T1, T2 {
    height: number
  }

  // zzz1.j = 'jfjasdjfjds'

  type A1 = 'x' extends 'x' ? string : number;
  type A2 = 'x' | 'y' extends 'x' ? string : number;
  
  type Pp<T> = T extends 'x' ? string : number;
  type A3 = Pp<'x' | 'y'>; // number | string

  jQuery(1)
}

